Skip to content

pythonInterpreters: don't use with pkgs#196052

Merged
FRidh merged 2 commits intoNixOS:masterfrom
Artturin:pythonstuff1
Oct 15, 2022
Merged

pythonInterpreters: don't use with pkgs#196052
FRidh merged 2 commits intoNixOS:masterfrom
Artturin:pythonstuff1

Conversation

@Artturin
Copy link
Member

Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@Artturin Artturin requested a review from FRidh as a code owner October 14, 2022 20:39
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Oct 14, 2022
@Artturin Artturin added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Oct 14, 2022
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Oct 14, 2022
@Artturin
Copy link
Member Author

this used to fail but now works

diff --git a/pkgs/development/python-modules/xpybutil/default.nix b/pkgs/development/python-modules/xpybutil/default.nix
index cc574c58241..81a0f39abfe 100644
--- a/pkgs/development/python-modules/xpybutil/default.nix
+++ b/pkgs/development/python-modules/xpybutil/default.nix
@@ -17,6 +17,10 @@ buildPythonPackage rec {
 
   propagatedNativeBuildInputs = [ xcffib ];
 
+  preBuild = ''
+    python3 --version
+  '';
+
   # no tests
   doCheck = false;
 

pkgsCross.aarch64-multiplatform.python3Packages.xpybutil

python3.10-xpybutil> /nix/store/7xrm67jylq3xbz2iczlw13llachbahwf-stdenv-linux/setup: line 87: /nix/store/lnz01g03dzvgkxqfanvvq5h05r46bffk-python3-aarch64-unknown-linux-gnu-3.10.7/bin/python3: cannot execute binary file: Exec format error

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't comment on the __splicedPackages changes

BEFORE:

the python derivation did not contain .nativeDrv and .crossDrv because
it was not from the __splicedPackages set

the python used in mk-python-derivation.nix was for host

```
nix-repl> pkgsCross.aarch64-multiplatform.python3Packages.xpybutil.nativeBuildInputs
[ «derivation /nix/store/bhz39ds4v02hn6x4py4mzjyilw4a589h-python3-aarch64-unknown-linux-gnu-3.10.7.drv» «derivation /nix/store/v880cnh4ml7czmivfbk3cdh93hz9yvbn-hook.drv» «derivation /nix/store/f243ab7wv92gqsmc9h7gr0qcnj0xcgdb-hook.drv» «derivation /nix/store/880lf8895bzn8d94lrr2y7ilgkxq0lc4-python-remove-tests-dir-hook.drv» «derivation /nix/store/fzjnhawfs1wpw58hcd1vxd9y750dc08y-python-remove-bin-bytecode-hook.drv» «derivation /nix/store/n8l59iparx98yfw8g5ydqmzmk3fdic75-setuptools-setup-hook.drv» «deri→
```

AFTER:

the python derivation does contain .nativeDrv and .crossDrv because
it is from the __splicedPackages set

those 2 are what makes nativeBuildInputs and buildInputs function
properly

the python used in mk-python-derivation.nix is for build

```
nix-repl> pkgsCross.aarch64-multiplatform.python3Packages.xpybutil.nativeBuildInputs
[ «derivation /nix/store/hvb9yxgv1133cfhxxd869sibldvv2vdx-python3-3.10.7.drv» «derivation /nix/store/v880cnh4ml7czmivfbk3cdh93hz9yvbn-hook.drv» «derivation /nix/store/f243ab7wv92gqsmc9h7gr0qcnj0xcgdb-hook.drv» «derivation /nix/store/880lf8895bzn8d94lrr2y7ilgkxq0lc4-python-remove-tests-dir-hook.drv» «derivation /nix/store/fzjnhawfs1wpw58hcd1vxd9y750dc08y-python-remove-bin-bytecode-hook.drv» «derivation /nix/store/n8l59iparx98yfw8g5ydqmzmk3fdic75-setuptools-setup-hook.drv» «derivation /nix/store/7vyhynla→
```
@FRidh FRidh merged commit c86122e into NixOS:master Oct 15, 2022
@FRidh
Copy link
Member

FRidh commented Oct 15, 2022

Thank you! Nice to see you digging in these parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants